The background description provided herein is for the purpose of generally presenting the context of the disclosure. Work of the presently named inventors, to the extent it is described in this background section, as well as aspects of the description that may not otherwise qualify as prior art at the time of filing, are neither expressly nor impliedly admitted as prior art against the present disclosure.
Today, languages and scripts can access elements in Hypertext Markup Language (HTML) or Extensible Markup Language (XML) documents using the Document Object Model (DOM) Application Programming Interface (API) calls. Generally speaking, DOM is a platform- and language-independent interface that defines a tree structure for a document and specifies access and manipulation methods for elements. For example, a program executing in a web browser, such as a JavaScript, can cause a DOM element to be rendered and specify actions to be carried out in response to mouse events or touchscreen events, such as click, mousemove (indicating movement of the mouse cursor), mouseover (indicating positioning of the mouse cursor over a shape or object), mousedown (indicating that the action button on the mouse is depressed), mouseup (indicating that the action button on the mouse is released), touchdown (indicating contact with a touch surface at a touch point), touchmove (indicating that the touch point moves along the touch surface), touchend (indicating end of contact with the touch surface), etc. As a more specific example, a script can include instructions for “dragging” a DOM element, i.e., repositioning the element on the screen in accordance with the number of pixels by which the mouse moved.
On the other hand, HTML documents also can include as elements drawable regions in which shapes rendered as pixels cannot be individually repositioned in response to mouse events or touchscreen events. For example, HTML standards define a canvas element with height and width attributes to provide scripts with a bitmap canvas, i.e., a pixel buffer corresponding to a drawable region. Scripts and programs can use canvas elements to render two-dimensional (2D) shapes, for example. While a script or program can render multiple shapes into a canvas element, this element does not include any information about the individual shapes